// @ts-nocheck
/* eslint-disable no-var */
import { Button } from "antd";
import { getAuthorButtons } from "@/api/modules/login";

const DataScreen = () => {
    const requestMenuList = async () => {
        const res = await getAuthorButtons();
        console.log(res);
        initMap()
    };
    //城地地图
   const initMap=() =>{
        const bridge = new window.CityGis.Bridge({
            id: "map",
            url: "http://10.237.18.193/citygis/citymap/WidgetPages/WidgetGIS.html?code=14&deviceType=lg",
            onReady: function() {
                //定位闪烁
                this.bridge.Invoke({
                    ActionName: "goToPosition",
                    Parameters: {
                        positon: {
                            x: 0,
                            y: 0,
                            z: 10,
                        },
                    },
                });
            },
        });
        //鼠标操作地图回发消息处理
        bridge.addEventListener(function(arg:any) {
            switch (arg.action) {
                case "mapclick":
                    //地图点选消息
                    break;
                case "ResetMap":
                    //地图重置完成消息
                    break;
                case "changeTheme":
                    //地图主题切换消息
                    break;
                case "Clear":
                    //地图清空消息
                    break;
            }
        }, window);
    }
    return (
        <div className="content-box" id="map"></div>
    );
};

export default DataScreen;
